package com.youpai.platform.common.config;

import com.qingstor.sdk.config.EnvContext;
import com.qingstor.sdk.service.QingStor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @date: 2022/3/19 14:24
 * @author: Anna
 * @version: 1.0
 * @description: QingCloud配置类
 */
@Configuration
public class QingStorConfig {

    @Value("${qingstor.accessKeyId}")
    private String accessKeyId;

    @Value("${qingstor.secretAccessKey}")
    private String secretAccessKey;

    @Bean
    public QingStor initQingStor() {
        EnvContext env = new EnvContext(accessKeyId, secretAccessKey);
        return new QingStor(env);
    }
}
